<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //1.判断两个值是否完全相等，几乎等同于===
        console.log(Object.is(120, 120)) //T
        console.log(Object.is(NaN, NaN)) //T ===返回F
        console.log(Object.is('12', 12)) //F

        //2.对象合并
        let config1 = {
            host: 'localhost',
            port: 3306,
            user: 'root',
            password: 'root'
        }

        let config2 = {
            host: '127.0.0.1',
            port: 3308,
            username: 'root',
            pass: 'root'
        }

        console.log(Object.assign(config1, config2)) //都有的属性用第二个参数的

        //3.设置原型对象
        let school = {
            name: 'sgg',
        }
        let cities = {
            xq: ['bj', 'sh', 'sz']
        }
        //console.log(school)
        console.log(Object.getPrototypeOf(school))
        Object.setPrototypeOf(school, cities)
        //console.log(school)
        console.log(Object.getPrototypeOf(school))
    </script>
</body>
</html>